package com.woniuxy;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.FileSystemResource;

/**
 * @Author 罗蔚
 * @Date 2022/3/23 17:49
 * @Description TODO
 */
public class TestSpringFirst {
    public static void main(String[] args) {
        //不常用, 从相对路径获取
        //BeanFactory beanFactory = new XmlBeanFactory(new ClassPathResource("applicationContext.xml"));
        //不常用, 从绝对路径获取
        XmlBeanFactory beanFactory = new XmlBeanFactory(new FileSystemResource("D:\\idea\\projectThree\\day01springdemo\\src\\applicationContext.xml"));


        Person person = (Person) beanFactory.getBean("chinese");
        person.show();
    }
}
